import Icon from '@/components/Icon';
import styles from './index.module.scss';
import dayjs from 'dayjs';

type Props = {
  commentReply: any;
};

export default function CommentReply({ commentReply }: Props) {
  if (!commentReply.aut_name) return <h3>这里是评论列表</h3>;

  return (
    <div className={styles.root}>
      {/* 评论者头像 */}
      <div className="avatar">
        <img src={commentReply.aut_photo} alt="" />
      </div>

      <div className="comment-info">
        {/* 评论者名字 */}
        <div className="comment-info-header">
          <span className="name">{commentReply.aut_name}</span>

          {/* 关注或点赞按钮 */}
          <button>关注</button>
        </div>

        {/* 评论内容 */}
        <div className="comment-content">{commentReply.content}</div>

        <div className="comment-footer">
          {/* 回复按钮 */}

          {/* <span className="replay">
            {commentReply.reply_count}回复 <Icon type="iconbtn_right" />
          </span> */}

          {/* 评论日期 */}
          <span className="comment-time">
            {/* {dayjs(commentReply.pubdate).format('YYYY-MM-DD hh:mm:ss')} */}
            {dayjs().from(commentReply.pubdate)}
          </span>
          <span className="thumbs-up">
            {commentReply.like_count}
            <Icon
              type={
                commentReply.is_liking ? 'iconbtn_like_sel' : 'iconbtn_like2'
              }
            />
          </span>
        </div>
      </div>
    </div>
  );
}
